﻿using Google.Apis.Tasks.v1.Data;
using System;
using System.Collections;
using System.Linq;
using System.Text;

namespace G_Tasks
{
    class TasksComparer : IComparer
    {
        public int Compare(object x, object y)
        {
            NoteItem t1 = (x as TasksListViewItem).note;
            NoteItem t2 = (y as TasksListViewItem).note;
            
            if (((t1.NoteFinished) && (t2.NoteFinished)) || ((!t1.NoteFinished) && (!t2.NoteFinished)))
                return t1.NoteDue.CompareTo(t2.NoteDue);
            else
                return t1.NoteFinished.CompareTo(t2.NoteFinished);
        }
    }
}
